﻿@{
    Layout = null;
}
@* 码分配 *@

<script src="~/Scripts/WebUploader/jquery.cookie.js"></script>


<div class="mtlr15">
    <form id="SearchForm" role="form" onkeydown="if(event.keyCode==13){return false;}">
        <div class="row">
            <div class="col-lg-7 col-md-7 col-sm-7" style="padding:0">
                <button type="button" class="btn btn-success" onclick="$.MGJ.AllotCode.Dialog_AllotCode()">
                    <i class="glyphicon glyphicon-plus-sign"></i>
                    码分配
                </button>
                <button type="button" class="btn btn-success" onclick="$.MGJ.AllotCode.ExprotExcel('#tableList')">
                    <i class="glyphicon glyphicon-arrow-down"></i>
                    导出excel
                </button>
            </div>

            <div class="col-lg-5 col-md-5 col-sm-5">
                <div class="input-group">
                    <div style="width:100%;display:none"></div>
                    <input id="Nor_SerialNum" type="text" class="form-control" placeholder="流水号" onkeydown="if (event.keyCode == 13) { $.MGJ.AllotCode.GetCurrentUserAllotList(1); }">
                    <span class="input-group-addon" onclick="$.MGJ.AllotCode.GetCurrentUserAllotList(1);">
                        <span class="glyphicon glyphicon-search"></span>
                    </span>
                    <div class="input-group-btn" style="margin-left:1px;" onclick="detailSearch(this); $.MGJ.AllotCode.SetSearchType()">
                        <button type="button" class="btn btn-default" style="border: 1px solid transparent;">
                            更多搜索
                            <span class="caret"></span>
                        </button>
                    </div>
                </div>
            </div>
        </div>
        <div class="detail-search-con" style="display:none">
            <div class="row newrow">
                <div class="col-lg-1 col-md-1 col-sm-1 col-lg-offset-1 col-md-offset-1 col-sm-offset-1 text-right" style="padding:0">
                    产品名称
                </div>
                <div class="col-lg-2 col-md-2 col-sm-2">
                    <input id="SProductName" type="text" name="StartDate" class="form-control" placeholder="产品名称" />
                </div>
                <div class="col-lg-1 col-md-1 col-sm-1 col-sm-2 text-right" style="padding:0">
                    发往机构
                </div>
                <div class="col-lg-2 col-md-2 col-sm-2 col-sm-3">
                    <input id="S_T_EName" type="text" name="EndDate" class="form-control" placeholder="发往机构" />
                </div>

            </div>
            <div class="row newrow">
                <div class="col-lg-1 col-md-1 col-sm-1 col-lg-offset-1 col-md-offset-1 col-sm-offset-1 text-right" style="padding:0">
                    流水号
                </div>
                <div class="col-lg-2 col-md-2 col-sm-2">
                    <input type="text" id="SSerialNum" name="Code" class="form-control" placeholder="流水号" />
                </div>
                <div class="col-lg-1 col-md-1 col-sm-1 col-sm-2 text-right" style="padding:0">
                    审核状态
                </div>
                <div class="col-lg-2 col-md-2 col-sm-2 col-sm-3">
                    <select class="form-control" id="SVerifieState">
                        <option value="">--请选择--</option>
                        <option value="0">末审核</option>
                        <option value="1">审核通过</option>
                        <option value="2">未通过</option>
                    </select>
                </div>
                <div class="col-lg-2 col-md-2 col-sm-2 col-sm-2 text-center">
                    <button type="button" class="btn btn-default" style="margin-left:23px;" onclick="$.MGJ.AllotCode.GetCurrentUserAllotList(1);">
                        <span class="glyphicon glyphicon-search"></span>
                        搜索
                    </button>
                    <button type="reset" class="btn btn-default">
                        重置
                    </button>
                </div>
            </div>
        </div>
    </form>

    <div id="wh100">
        <div class="fixed-table">
            <div id="over">
                <div class="fixed-table-left">
                    <table>
                        <thead>
                            <tr>
                                <th width="15"><input type="checkbox" class="AllClickCheckbox"></th>
                                <th class="text-center">流水号</th>
                            </tr>
                        </thead>
                        <tbody id="OMID_left" style="display:none;" binding="{'pageId':'ShoppingPager','pageCallback':'$.MGJ.AllotCode.GetCurrentUserAllotList'}">
                            <tr>
                                <td width="15"><input type="checkbox" class="AllClickChild" binding="{'ID':'ID'}"></td>
                                <td binding="{'text':'SerialNum'}"></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="fixed-table-middle" style="width:100%;">
                    <table style="width:100%;">
                        <thead>
                            <tr>
                                <th width="15"><input type="checkbox" class="AllClickCheckbox"></th>
                                <th>流水号</th>
                                <th>发起方式</th>
                                <th>申请时间</th>
                                <th>分配方式</th>
                                <th>分配时间</th>
                                @*<th>起始码</th>
                                <th>结束码</th>*@
                                <th>码批次</th>                               
                                <th>发往机构</th>
                                <th>产品名称</th>
                                <th>标签数量</th>
                                <th>审核状态</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody id="tableList" style="display:none;" binding="{'pageId':'ShoppingPager','pageCallback':'$.MGJ.AllotCode.GetCurrentUserAllotList','emptyHtml':OMID_EmptyHtml}">
                            <tr>
                                <td width="15"><input type="checkbox" class="AllClickChild" binding="{'ID':'ID'}"></td>
                                <td binding="{'text':'SerialNum'}"></td>
                                <td binding="{'text':'SerialNum','textHandle':$.MGJ.AllotCode.ReturnLaunchName}"></td>
                                <td binding="{'text':'ApplyDate','textHandle':'datetime'}"></td>    
                                <td class="AllotType" binding="{'text':'AllotType','textHandle':$.MGJ.AllotCode.ReturnAllotTypeName}"></td>
                                <td binding="{'text':'AllotDate','textHandle':'datetime'}"></td>
                                @*<td class="StartCode" binding="{'text':'StartCode','textHandle':$.MGJ.AllotCode.StartCode}"></td>
                                <td class="EndCode" binding="{'text':'EndCode','textHandle':$.MGJ.AllotCode.EndCode}"></td>*@
                                <td binding="{'text':'AllotBatch'}"></td>                          
                                <td binding="{'text':'T_EnterpriseName'}"></td>
                                <td class="AllotProductName" binding="{'text':'AllotProductName','textHandle':$.MGJ.AllotCode.AllotProductName}"></td>
                                <td class="AllotCount" binding="{'text':'AllotCount','textHandle':$.MGJ.AllotCode.AllotCount}"></td>
                                <td  class="handleType" binding="{'text':'HasVerifie','textHandle':$.MGJ.AllotCode.ReturnVerifieState}"></td>
                                <td>
                                    @*<a>审核</a>
                                    <a>查看</a>*@
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="fixed-table-right">
                    <table>
                        <thead>
                            <tr>
                                <th style="padding:6px 15px 7px;">操作</th>
                            </tr>
                        </thead>
                        <tbody id="OMID_right" binding="{'pageId':'ShoppingPager','pageCallback':'$.MGJ.AllotCode.GetCurrentUserAllotList'}">
                            <tr>
                                <td style="padding:6px 15px 7px;" binding="{'text':'HasVerifie','textHandle':$.MGJ.AllotCode.ReturnOpButton}">

                                    <!--占位-->
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div id="ShoppingPager"></div>
        </div>
    </div>
</div>
<script src="~/Scripts/MGJJS/CodeManage/AllotCode.js"></script>
<script src="~/Scripts/MGJJS/CodeManage/RawCode.js"></script>

<script>
    var ColspanNub = $(".fixed-table-middle").find("tr").children("td").length
    window.OMID_EmptyHtml = '<tr><td colspan="' + ColspanNub + '"><p class="no-result">无符合条件的数据结果</p></td></tr>';

    $(function () {
        $.MGJ.AllotCode.GetCurrentUserAllotList(1);
    })

    $('#SearchForm').bootstrapValidator({
        fields: {
            StartDate: {
                validators: {
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '产品名称不能输入符号'
                    }
                }
            },
            EndDate: {
                validators: {
                    regexp: {
                        regexp: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/,
                        message: '发往机构不能输入符号'
                    }
                }
            },
            Code: {
                validators: {
                    regexp: {
                        regexp: /^[a-zA-Z0-9]+$/,
                        message: '流水号只能输入字母和数字'
                    }
                }
            }
        }
    })
</script>